<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>

<!DOCTYPE>
<html>
<head content="-登录">
    <%@ include file="/resources/modular/head/outside-head.jsp" %>
</head>
<body>
<div class="loading"></div>
<header class="header"></header>
<div class="page"
     style="background:linear-gradient(top, #f3f6f8 51.5%, #38adff 52%);background:-webkit-linear-gradient(top, #f3f6f8 51.5%, #38adff 52%);background:-moz-linear-gradient(top, #f3f6f8 51.5%, #38adff 52%);">
    <div class="loginpage">
        <div class="login_bg">
            <div class="login_dv">
                <h3>用户登录</h3>
                <%--<span class="scantext">扫码登录更安全</span>
                <i class="scanimg"></i>--%>

                <p id="login_point" class="point">手机号/用户名与密码不匹配</p>
                <!--账号密码登录-->
                <form class="login_form">
                    <span>登录名：</span><br>
                    <input id="username" class="login_username" type="text" placeholder="手机号/用户名" required name="username">
                    <span>登录密码：</span><br>
                    <input id="password" class="login_userpassword" type="password" placeholder="请输入登录密码" required value="123456" >
                    <input id="vildCode" class="login_imagecode" type="text" placeholder="请输入验证码" required
                           name="vildCode">
                    <input  id="ciphertext" type="hidden" name="password">
                    <a class="login_codeurl" href="javascript:;"><img onclick="chageCode()" id="captchaImage"
                                                                      src="${basePath}v2/authCode" alt="验证码"><span
                            onclick="chageCode()">&nbsp;换一张</span></a>
                    <input class="login_btn" type="button" value="登 录">
                </form>

                <%--<!--扫码登录-->
                <div class="login_codedv">
                    <div><img src="${basePath}resources/images/web/v2/login/code.png" alt="二维码"></div>
                    <p>打开<a href="javascript:;">手机游艺云</a>，扫一扫登录<br><span>更安全的登录方式</span></p>
                </div>--%>
            </div>
        </div>
    </div>
</div>

</body>
</html>
<%@ include file="/resources/modular/foot/outside_footer.jsp" %>
<script type="text/javascript" src="${basePath}resources/js/v2/youyicloud-md5.js"></script>
<script>

    /*更新图片验证码*/
    function chageCode() {
        $('#captchaImage').attr('src', '${basePath}v2/authCode?abc=' + Math.random());//链接后添加Math.random，确保每次产生新的验证码，避免缓存问题。
    }

    /*登录函数*/
    function userSignin() {
        var password = $("#password").val();
        if (typeof(password) == "undefined" || password.length == 0) {
            $("#login_point").text("密码不能为空");
            return false;
        } else {
            $("#ciphertext").val(createPassword(password, password));
            $.ajax({
                url: '${basePath}v2/factorysignin',
                type: 'POST',
                data: $(".login_form").serialize(),
                error: function (response) {
                    $errorMsg(response);
                },
                success: function (ret) {
                    if (ret.result) {
                         window.location = "${basePath}v2/factory/account/todayView";
                    } else {
                        $("#login_point").text(ret.info).addClass("cur");
                        /* $.messager.alert('温馨提醒',ret.info,'error'); */
                    }
                }
            });
        }
    }

</script>